package com.raos.example.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 员工实体类
 *
 * @author raos
 * @email 991207823@qq.com
 * @date 2023-08-26 8:58
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table("tb_employee")
public class EmployeeEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @ColumnWidth(10)
    @ExcelProperty({"员工信息","ID"})
    @Id(value = "employee_id", keyType = KeyType.Auto)
    private Long employeeId;
    @ColumnWidth(12)
    @ExcelProperty({"员工信息","姓名"})
    @Column(value = "employee_name") // 在mybatisflex中默认开启下划线转小驼峰-可不写@Column标注数据库中的表列名
    private String employeeName;
    @ColumnWidth(10)
    @ExcelProperty({"员工信息","年龄"})
    private Integer age;
    @ColumnWidth(10)
    @ExcelProperty({"员工信息","性别"})
    private String gender;
    @ColumnWidth(20)
    @ExcelProperty({"员工信息","创建时间"})
    @Column(value = "create_time")
    private LocalDateTime createTime;

}
